package net.spacebeeshooter.gui;

import java.awt.BorderLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.JButton;
import javax.swing.JPanel;

public class ButtonPanel extends JPanel {

	private static final long serialVersionUID = -2295158011267860662L;
	
	private JButton btnSave;
	private JButton btnExit;
	
	public ButtonPanel(SaveListener saveListener, String saveText, String exitText) {
		setLayout(new BorderLayout(0, 0));
		
		btnSave = new JButton(saveText);
		btnSave.addActionListener(saveListener);
		add(btnSave, BorderLayout.WEST);
		
		btnExit = new JButton(exitText);
		btnExit.addActionListener(new ActionListener() {
			@Override
			public void actionPerformed(ActionEvent e) {
				System.exit(0);
			}
		});
		add(btnExit, BorderLayout.EAST);
	}
}
